<?php

include_once APPLICATION_DIR . "/application/model/TESTIMONIAL.php";

class Testimonial  extends DataObjects_TESTIMONIAL
{
	public function validateInput(){
        global $error_msg;
		
		$posted_file = $_FILES["IMAGE"];
		if ($error_msg->isNoError() && !empty($posted_file["name"])) {
			if ($this->ID) {
				$this->OLD_IMAGE = $this->IMAGE;
			}
            $upload = new UPLOAD();
			$new_file = $upload->doUploadImage(IMAGE_DIR."/", 'IMAGE', '', '200', '');
			if ($new_file) {
				$this->IMAGE = $new_file;
			} else {
				$error_msg->add('_MSG_UPLOAD_FAILED');
			}
		}
		return $error_msg->isNoError();
    }

	public function update() {
		return parent::update();
	}

	public function delete() {
		return parent::delete();
	}
    public function status2Text($status){
        return status2Text($status);
    }
}
?>
